<template>
    <div class="tree-view">
      <h1>代码首页</h1>
      <div class="params">
        <h2>当前路由参数：</h2>
        <p>branch: {{ route.params.branch }}</p>
        <p>dir: {{ route.params.dir }}</p>
      </div>
      <div class="raw">
        <h2>完整路由信息：</h2>
        <pre>{{ route }}</pre>
      </div>
    </div>
  </template>
  
  <script setup>
  import { useRoute } from 'vue-router'
  
  const route = useRoute()
  </script>
  
  <style scoped>
  .tree-view {
    padding: 20px;
  }
  .params {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  .raw {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
  }
  pre {
    white-space: pre-wrap;
  }
  </style>